home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Panorama / Panorama - Disk 19D (1987-07-22)(Pacific North-West Amigas Club)[WB].zip / Panorama - Disk 19D (1987-07-22)(Pacific North-West Amigas Club)[WB].adf / HackBench / hb.h < prev    next >
C/C++ Source or Header  |  1987-07-14  |  3KB  |  111 lines

  1. /****************************************************************
  2. /*                                *
  3. /*    HackBench - Part 1 of 4 - hb.h - Definitions        *
  4. /*                                *
  5. /*    Copyright (C) 1987 by Bill Kinnersley            *
  6. /*    CS Dept, Washington State Univ, Pullman, WA 99164    *
  7. /*                                *
  8. /*    Permission granted to redistribute this program        *
  9. /*    provided the copyright notice remains intact.        *
  10. /*    May not be used as part of any commercial product.    *
  11. /*                                *
  12. /****************************************************************/
  13.  
  14. #include <stdio.h>
  15. #include <exec/memory.h>
  16. #include <exec/alerts.h>
  17. #include <workbench/workbench.h>
  18. #include <workbench/startup.h>
  19. #include <intuition/intuitionbase.h>
  20. #include <libraries/dosextens.h>
  21. #include <functions.h>
  22. #include <clib/macros.h>
  23.  
  24. #define BLACK_FILL  (ITEMTEXT | HIGHCOMP)
  25. #define MN(m,i) ((long)(SHIFTMENU(m)|SHIFTITEM(i)|SHIFTSUB(0x1f)) & 0xffffL)
  26. #define MEMF_CPC    (MEMF_CHIP | MEMF_PUBLIC | MEMF_CLEAR)
  27. #define ALLOC(st)   (struct st *)AllocMem((long)sizeof(struct st), MEMF_CPC)
  28. #define SHIFT        (IEQUALIFIER_LSHIFT | IEQUALIFIER_RSHIFT)
  29. #define OBJ(nd,of) ((struct MyWBObject *)((long)(nd)-of*sizeof(struct Node)))
  30.  
  31. struct MyDrawerData {
  32.     struct NewWindow dd_NewWindow;
  33.     LONG dd_CurrentX, dd_CurrentY, dd_MinX, dd_MinY, dd_MaxX, dd_MaxY;
  34.     struct Gadget dd_HorizScroll, dd_VertScroll,
  35.         dd_UpMove, dd_DownMove, dd_LeftMove, dd_RightMove;
  36.     struct Image dd_HorizImage, dd_VertImage;
  37.     struct PropInfo dd_HorizProp, dd_VertProp;
  38.     struct Window *dd_DrawerWin;
  39.     struct List dd_Children;    /* Must be initialized */
  40.     BPTR dd_Lock;
  41. };
  42.  
  43. struct MyWBObject {
  44.     struct Node wo_MasterNode, wo_Siblings,
  45.         wo_SelectNode, wo_UtilityNode;
  46.     struct MyWBObject *wo_Parent;
  47.     UBYTE wo_Flags;
  48.     char *wo_Name;
  49.     SHORT wo_NameXOffset, wo_NameYOffset;
  50.     struct FreeList wo_FreeList;    /* Must be initialized */
  51.     struct Window *wo_IconWin;
  52.     BPTR wo_Lock;
  53.     struct Gadget wo_Gadget;
  54.     UBYTE wo_Type;
  55.     char *wo_DefaultTool, **wo_ToolTypes;
  56.     LONG wo_CurrentX, wo_CurrentY;
  57.     struct MyDrawerData *wo_DrawerData;
  58.     char *wo_ToolWindow;
  59.     LONG wo_StackSize;
  60. };
  61.  
  62. /* Gadget ID's */
  63. #define GID_WBOBJECT       0L
  64. #define GID_HORIZSCROLL    1L
  65. #define GID_VERTSCROLL     2L
  66. #define GID_LEFTSCROLL     3L
  67. #define GID_RIGHTSCROLL    4L
  68. #define GID_UPSCROLL       5L
  69. #define GID_DOWNSCROLL     6L
  70. #define GID_NAME           7L
  71.  
  72. /* Menu Items */
  73. #define OPEN    MN(0,0)
  74. #define CLOZE    MN(0,1)
  75. #define DUP    MN(0,2)
  76. #define RENAME    MN(0,3)
  77. #define INFO    MN(0,4)
  78. #define DISCARD    MN(0,5)
  79.  
  80. #define EMPTY    MN(1,0)
  81. #define INIT    MN(1,1)
  82.  
  83. #define CLEANUP    MN(2,0)
  84. #define ERROR    MN(2,1)
  85. #define REDRAW    MN(2,2)
  86. #define SNAP    MN(2,3)
  87. #define VERS    MN(2,4)
  88.  
  89. #define TRACE    MN(3,0)
  90. #define WBOBJS    MN(3,1)
  91. #define SELOBJS    MN(3,2)
  92. #define UTILOBJS MN(3,3)
  93. #define CHILDREN MN(3,4)
  94. #define QUIT    MN(3,5)
  95.  
  96. /* Offsets for Object Lists */
  97. #define MAST 0L
  98. #define CHILD 1L
  99. #define SEL 2L
  100. #define UTIL 3L
  101.  
  102. /* Object Flags */
  103. #define NORM 0
  104. #define HIGH 1
  105. #define RESIZE 2
  106. #define TEMPLOCK 4
  107.  
  108. /* Window top border */
  109. #define YOFF 10L
  110.  
  111.